import { reqDayRecommend } from '@/api/home'

export default {
    namespaced: true,
    actions: {
        //获取每日推荐
        async getRecommend({ commit }) {
            let result = await reqDayRecommend()
            // console.log(result);
            if (result.data.code == 200) {
                commit('GETRECOMMEND', result.data.data.dailySongs)
            }
        }
    },
    mutations: {
        //决定每日推荐是否展示
        ISRECOMMEND(state, value) {
            state.isRecommend = value
        },
        //存储每日推荐按
        GETRECOMMEND(state, value) {
            state.dailySongs = value || []
        }
    },
    state: {
        isRecommend: false,
        dailySongs: []
    },
    getters: {

    }
}